package com.cndw.kungfu.config;

import java.text.ParseException;

import com.cndw.kungfu.ext.TimeProcesser;

public class ConstantsCore {

	/**
	 * 首冲礼包额度控制
	 */
	public static final int[] payFirstGrade = { 0, 100, 500, 1000, 3000, 5000 };
	/**
	 * 充值禮包獎勵
	 */
	public static final int[] payGiftGrade = { 0, 10, 50, 100, 300, 500};
	/**
	 * 黄钻领取的标记
	 */
	public static final int yelGotSign = 6;
	
	/**
	 * 限时购买的id
	 */
	public static final int buyLimitId = 103994;
	/**
	 * 充值活動開始時間
	 */
	public static final int activityBeginTime;
	/**
	 * 门下高徒反馈
	 */
	private static int discipleFeedBeginTime;
	/**
	 * 徒弟反馈的类型
	 */
	public static final int[] discipleEventIds = {ConstantsCost.discipleTrain,ConstantsCost.featureRefresh,ConstantsCost.featureUpgrade};
	
	public static int updateLastTime;

	static {
		int tmpBeginTime = 0;
		try {
			tmpBeginTime = TimeProcesser.getUnixTimeByString("2012-03-07 07:00:00");
		} catch (ParseException e) {
			e.printStackTrace();
		}
		activityBeginTime = tmpBeginTime;
		try {
			updateLastTime = TimeProcesser.getUnixTimeByString("2012-11-13 09:00:00");//每周维护版本号
		}catch (Exception e) {
			e.printStackTrace();			
		}
		try {
			discipleFeedBeginTime = TimeProcesser.getUnixTimeByString("2012-05-25 07:00:00");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static int getActivityBegin() {
		if (activityBeginTime > ConstantsConfig.getSysCgOpenTime()) {
			return activityBeginTime;
		}
		return ConstantsConfig.getSysCgOpenTime();
	}

	public static int getActivityEnd() {
		return getActivityBegin() + 86400 * 14;
	}

	public static int getUpdateLastTime() {
		return updateLastTime;
	}

	public static int getDiscipleFeedBeginTime() {
		return discipleFeedBeginTime;
	}
	
	public static int getDiscipleFeedEndTime(){
		return getDiscipleFeedBeginTime() + 86400 * 14;
	}
	
	
	
}
